package com.pansoft.mobilefitness.view;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import com.efounder.chat.view.CommonOtherPopWindow;
import com.efounder.frame.activity.EFTransformFragmentActivity;
import com.efounder.frame.baseui.BaseFragment;
import com.efounder.frame.utils.EFFrameUtils;
import com.pansoft.mobilefitness.R;

/**
 * @author : zzj
 * @e-mail : zhangzhijun@pansoft.com
 * @date : 2019/2/1 11:49
 * @desc :
 * @version: 1.0
 */
public class PopManager {

    public static void showPop(final Context context, View imageView){
        final CommonOtherPopWindow commonOtherPopWindow = new CommonOtherPopWindow((Activity) context);
        commonOtherPopWindow.addMenuButton(context.getString(R.string.new_asset_add_device), R.drawable.fitness_more_add_new_device, true)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
//                        Bundle bundle = new Bundle();
//                        bundle.putBoolean(EFTransformFragmentActivity.EXTRA_HIDE_TITLE_BAR, true);
//                        try {
//                            EFFrameUtils.pushFragment((Class<? extends BaseFragment>) Class.forName("com.efounder.fragment.MallCartFragment"), bundle);
//                        } catch (ClassNotFoundException e) {
//                            e.printStackTrace();
//                        }
                        commonOtherPopWindow.dismiss();
                    }
                });

        commonOtherPopWindow.showPopupWindow(imageView);
    }
}
